package com.atmilan.quartz.constant.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 渠道类型
 * @Description: 
 * @author daigb
 * @date 2021-02-01
 */
public enum ChannelTypeEnum implements IEnum<Integer> {
    /**
     * 天猫
     */
    TIANMAO(1, "天猫"),
    /**
     * 对外api接口商户
     */
    OUT_API(9, "对外api接口商户"),
    ;

    private Integer code;
    private String msg;

    public static ChannelTypeEnum valueOf(Integer code) {
        for (ChannelTypeEnum value : values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        
        return null;
    }

    ChannelTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    @JsonValue
    public Integer getValue() {
        return code;
    }

}
